/*
 * HelloWorldWidget - extends PWF.Widget
 *
 */

PWF.create('HelloWorldWidget', PWF.Widget, 
{
	/** Override default properties here */
	init: function()
	{
		//specify a specific widget size
		this.width = 200;
		this.height = 100;
	},
	/** Implement widget functionality here */
	widgetLoaded: function()
	{	
		// grab references to our widget elements
		var lblHello = this.getElement('helloWorldWidget_lblHello');	
		var btnSayHello = this.getElement('helloWorldWidget_btnSayHello');	

		// listen for button click		
		btnSayHello.observe('click', function() 
		{
			Log.debug('btnSayHello click registered');
			
			// update the label
			lblHello.update("HELLO WORLD!");
			
			// disable button
			btnSayHello.disable();
		});
	}
});
